package com.qf.votesystem.vo;

import com.qf.votesystem.Contants.Constants;

import java.util.HashMap;

public class ResultVo extends HashMap {

    public static ResultVo ok(){

        final ResultVo resultVo = new ResultVo();

        resultVo.put("code", Constants.SUCCESS_CODE);
        resultVo.put("msg",Constants.SUCCESS_MSG);

        return resultVo;
    }

    public static ResultVo error(Object msg) {

        final ResultVo resultVo = new ResultVo();

        resultVo.put("code", -1000);
        resultVo.put("msg",msg);

        return resultVo;
    }
}
